import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * The Ending Screen for the game
 */
public class EndingScreen  extends Actor
{
    retroWorld theWorld;
    WavPlayer soundBite;
    PlayAgainButton playAgainButton;


    public EndingScreen()
    {
        soundBite = new WavPlayer();
        soundBite.open("imgood.wav");
        soundBite.setLoops(1);
        soundBite.play();
    }   
    
    public void addedToWorld(World world)
    {
        theWorld = (retroWorld)world;
        theWorld.addObject(new Lolzturtle(), 445, 200);  // HERE IS WHERE PROBLEM IS TO DELETE ALL OF THE STUFF FROM WORLD
        playAgainButton = new PlayAgainButton();    
       
        theWorld.addObject(playAgainButton, 450, 380);
    }
    
    public void act(){
        
         if(Greenfoot.mousePressed(playAgainButton))
        {
          
             
              
                theWorld.getSimon().dead();
           
                theWorld.removeObjects(theWorld.getObjects(null));
                theWorld.reset();
        }    
        
        

        
    }
}
